const mongoose = require("./db")
const conn = mongoose.connection
conn.on("error", () => console.log("连接数据库失败"))

// 模型对象
const UserSchema  = mongoose.Schema({
  userId: { type: String },
  userName: { type: String }, //昵称
  sex: { type: String }, //性别
  phone: { type: String }, //手机号
  password: { type: String }, //密码
  addTime: { type: String } //创建时间
});

const user = mongoose.model("users", UserSchema )
module.exports = user